﻿@using PagedList.Mvc
@using HtmlHelper = System.Web.WebPages.Html.HtmlHelper
@model  PagedList.IPagedList<DemoUserInfo.Models.Article>


<h2>DelList</h2>

<div class="row">
    <div class="col-md-8">
        <table class="table">
            <tr>
                <th>
                    Title
                </th>
                <th>
                    Author
                </th>
                <th>
                    Date
                </th>
            </tr>

            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Title)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Author)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Date)
                    </td>

                    <td>
                        @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                        @Html.ActionLink("Delete", "Delete", new { id = item.Id })
                    </td>
                </tr>
            }
        </table>
        <h6><small>Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount</small></h6>
    </div>


    <div class="col-md-4">
        @using (Html.BeginForm("DelList", "Articles", FormMethod.Post, new { @class = "form-group" }))
        {
            <div class="col-md-9">
                <input name="search" type="text" placeholder="search" class="form-control" />
            </div>
            <div class="col-md-3">
                <button type="submit" class="btn btn-default">Search</button>
            </div>
        }
    </div>
</div>